<?php

use yii\helpers\Html;
use yii\widgets\DetailView;
use common\models\Company;

/* @var $this yii\web\View */
/* @var $model common\models\Company */

$this->title = $model->id;
$this->params['breadcrumbs'][] = ['label' => '供应商', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="company-view">

    <h1><?= Html::encode($this->title) ?></h1>

    <p>
        <?= Html::a('修改', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
        <?= Html::a('删除', ['delete', 'id' => $model->id], [
            'class' => 'btn btn-danger',
            'data' => [
                'confirm' => '确定要删除此企业？',
                'method' => 'post',
            ],
        ]) ?>
    </p>

    <?= DetailView::widget([
        'model' => $model,
        'attributes' => [
            'id',
            'username',
            'company_name',
            'company_no',
            [
                'attribute'=> 'company_type',
                'value' => Company::itemAlias("company_type", $model->company_type),
            ],
            'logo:url',
            [
                'attribute'=> 'province',
                'value' => Company::region('1',$model->province)
            ],
            [
                'attribute'=> 'city',
                'value' => Company::region('2',$model->city)
            ],
            [
                'attribute'=> 'status',
                'value' => Company::itemAlias("status", $model->status),
            ],  
            'address_detail',
            'contact_name',
            'contact_tel',
            'job_title',
            'remark',
            'create_time',
        ],
    ]) ?>

</div>
